Latest Microsoft Dynamics 365 Blogs | CloudFronts

Flexible Line Display in Purchase Order Report – Business Central RDLC Layout

When working on report customizations in Microsoft Dynamics 365 Business Central, one common challenge is maintaining a consistent layout regardless of how many lines are present in the data source. This situation often arises in reports like Purchase Orders, Sales Orders, or Invoices, where the line section expands or contracts based on the number of lines in the dataset. However, certain business scenarios demand a fixed or uniform presentation, such as when a client wants consistent spacing or placeholders for manual inputs. This article demonstrates how you can achieve this flexibility purely through RDLC layout design – without making any changes in AL or dataset logic. Business Requirement The objective was to design a Purchase Order report where the line area maintains a consistent structure, independent of how many lines exist in the actual data. In other words, the report layout should not necessarily reflect the dataset exactly as it is. The idea was to ensure visual uniformity while keeping the underlying data logic simple. Proposed Solution The solution was implemented directly in the RDLC report layout by creating two tables and controlling their visibility through expressions. There was no need to align them in the same position one table was placed above the other. RDLC automatically handled which one to display at runtime based on the visibility conditions. Table 1 – Actual Purchase Lines Displays the real data from the Purchase Line dataset. Table 2 – Structured or Blank Layout Displays a predefined structure (for example, blank rows) when fewer lines are available. This design ensures that whichever table meets the visibility condition is rendered, maintaining layout flow automatically. Implementation Steps 1. Add Two Tables in the RDLC Layout 2. Set Visibility Conditions To control which table appears at runtime, open each table’s properties and go to:Table Properties → Visibility → Hidden → Expression Then apply the following expressions: For Table 1 (Actual Purchase Lines) =IIF(CountRows(“DataSet_Result”) <= 8, True, False) Hides the actual data table when the dataset has fewer rows. For Table 2 (Structured or Blank Layout) =IIF(CountRows(“DataSet_Result”) > 8, True, False) Hides the structured or blank table when enough data rows are available. Note: The number “8” is just an example threshold. You can set any value that fits your design requirement. Result At runtime: The RDLC engine handles layout adjustment, ensuring the report always looks uniform and visually balanced – without any need for AL code changes or temporary data handling. Advantages of This Approach Benefit Description No AL Code Changes Achieved entirely within RDLC layout. Upgrade Friendly Dataset and report objects remain unchanged. Automatic Layout Flow RDLC adjusts which table is displayed automatically. Professional Appearance Ensures consistent formatting and structure across all reports. Key Takeaways This simple yet effective approach shows that report design in Business Central can be made flexible without altering data logic.By using two tables with visibility expressions, you can create reports that adapt their appearance automatically – keeping the layout professional, stable, and easy to maintain. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com

Share Story :

Workspaces in Business Central AL Explained

When developing in Microsoft Dynamics 365 Business Central, you spend a lot of time working in Visual Studio Code. To streamline productivity and keep projects well-organized, workspaces in Business Central AL play a critical role. In this blog, we’ll explore what workspaces are, why they matter, and how you can use them effectively in your AL development journey. What is a Workspace in Business Central AL? A workspace in Visual Studio Code is essentially a container that holds your project’s structure, settings, and configurations. In Business Central AL development, a workspace defines: In short, a workspace ensures that everything needed to build and deploy an extension is neatly bundled together. Benefits of Using Workspaces Creating and Managing Workspaces Tip: Save your workspace using File > Save Workspace As… so you can reopen it quickly in future. Example: Multi-root Workspace When working with multiple extensions in a workspace, handling dependencies used to mean installing each required app one by one. Now, the development environment can automatically look at the dependency graph in your workspace and publish the necessary projects along with the one you selected. This way, you can focus on building and testing without worrying about missing dependencies. Imagine you’re working with multiple extensions in your Business Central environment: From the diagram: Base App ALProject1 ALProject2 ALProject3 Adding Folder to Workspace. Saving Workspace. Creating a separate folder to store workspaces. Publishing Full Dependency. This allows you to debug, build, and manage all the extensions from a single VS Code instance. Best Practices for Workspaces To conclude, workspaces in Business Central AL are more than just folders — they are the foundation of your development environment. By structuring your projects with well-maintained workspaces, you ensure smoother collaboration, better organization, and efficient extension deployment. If you’re just starting with AL, experiment with single-project workspaces, and as you grow, explore multi-root setups to manage larger development scenarios. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com

Share Story :

Preview and Download Selected Documents as PDFs in Business Central Using AL

In Microsoft Dynamics 365 Business Central, users frequently need to generate and review Purchase Order (PO) documents. Traditionally, this process involved downloading PDF files locally and then opening them with an external PDF viewer. While functional, this workflow can be inefficient, especially when reviewing multiple purchase orders. With recent enhancements in the AL language and web client capabilities, it is now possible to preview PDF documents directly within the browser, eliminating unnecessary steps and improving user experience. Additionally, Business Central continues to support direct file downloads for scenarios where saving a copy locally is required. This article presents a customization to the Purchase Order List page, allowing users to select multiple purchase orders and either preview or download their PDF documents using AL code. Functional Overview The proposed solution introduces a new action on the Purchase Order List page titled “Preview Selected Purchase Orders”. This action performs the following tasks: Role of Report Selections Report Selections play a vital role in ensuring flexibility and modularity. Instead of hardcoding specific report IDs, the system determines the report to be used for each Purchase Order based on vendor configuration. Example AL Snippet: This method respects configurations made in the Report Selection – Purchase page, allowing different vendors to use different report formats or layouts for the same document type. AL Implementation Below is the complete AL code for the pageextension object: File Handling Options: Preview vs Download Depending on business needs, developers can choose between two methods: 1. File.ViewFromStream 2. File.DownloadFromStream Output This customization provides two ways to handle PDF outputs for Purchase Orders: 1. For a Single Selected Document When a single purchase order is selected and the action is triggered: 2. For Multiple Selected Documents (Merged into One PDF) Business Benefits To Conclude, by leveraging AL capabilities such as Report Selections, Temp Blob, and the File data type methods, developers can significantly enhance document handling processes in Microsoft Dynamics 365 Business Central. Offering both in-browser preview and direct download options provides users with flexibility and improves overall productivity. This customization is a practical example of how small enhancements can deliver substantial value in day-to-day business operations. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com.

Share Story :

A Unified Approach to Developing Finance and Operations Applications

Microsoft’s Unified Developer Experience (UDE) helps developers build solutions that work across both Finance and Operations (F&O) and the Power Platform by providing a common, cloud-based environment. Challenges Before UDE Before UDE, developers often faced the following issues: What UDE Changes With UDE, Microsoft combines these tools into one environment, making it easier to: Why UDE Is Useful Adopting UDE brings several practical benefits for developers and organizations: Check Access, Licenses, and Capacity Before starting, make sure your user role, license, and environment capacity are all set up properly. You can check this in the Power Platform Admin Center. Starting the Setup with PowerShell To get started, open PowerShell ISE on your laptop. If you haven’t installed the required Power Platform module yet, run this command (skip it if it’s already installed): #Install the module Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force Next, sign in to your account and prepare the JSON template that defines your environment settings. Make sure DevToolsEnabled is set to true so developer tools are available. You can also set DemoDataEnabled to true if you want sample Contoso data included by default. Write-Host “Creating a session against the Power Platform API” Add-PowerAppsAccount -Endpoint prod #To construct the json object to pass in $jsonObject= @” { “PostProvisioningPackages”: [ { “applicationUniqueName”: “msdyn_FinanceAndOperationsProvisioningAppAnchor”, “parameters”: “DevToolsEnabled=true|DemoDataEnabled=true” } ] } “@ | ConvertFrom-Json Finally, you’re ready to start the environment deployment. New-AdminPowerAppEnvironment -DisplayName “EnvironmentName” -EnvironmentSku Sandbox -Templates “D365_FinOps_Finance” -TemplateMetadata $jsonObject -LocationName “unitedstates” -ProvisionDatabase Example: New-AdminPowerAppEnvironment -DisplayName “Basic_Env” -EnvironmentSku Sandbox -LocationName “unitedstates” -Templates “D365_FinOps_Finance” -TemplateMetadata $jsonObject -ProvisionDatabase Make sure to use a proper name for your environment — it must be 20 characters or fewer. Also, pick the correct data center location based on your region (for example, I used unitedstates, but you could choose India or another available region). Alternatively: Install on an Existing Environment If you already have a Power Platform environment with a Dataverse database, you can use it to install Finance and Operations apps. Simply select the environment, navigate to Resources > Dynamics 365 apps, and then select Dynamics 365 Finance and Operations Provisioning App. Once your environment is successfully provisioned, you’ll see it listed in the Power Platform Admin Center — just like in the screenshot above. Here’s what the key information means: You’ll also see links to manage: These settings help control access and structure within your environment. This confirms your Finance + Power Platform environment is now fully functional and integrated — ready for development, testing, and customization. Make sure your user account has the System Administrator security role in Dataverse. Once assigned, this role will automatically carry over to the Finance and Operations (F&O) environment — no need to reassign it separately. If you navigate to the Dynamics 365 apps, you’ll also find pre-configured and installed solutions available. You can check out the Modules, Packages, and Operation History by simply clicking on the Environment URL. System Requirements for Setting Up the Development Environment Before you begin working with the Unified Development Experience (UDE), it’s important to make sure your machine meets the basic hardware and software requirements. Here’s what you’ll need: Workstation Requirements To ensure smooth performance while developing: Required Software The following software components are essential for working with UDE in Visual Studio: Once everything is set up, you’re ready to open Visual Studio. Make sure to run it as Administrator and choose the “Continue without code” option when prompted. This ensures all tools load properly and you’re ready to begin your development work. Install Power Platform VS Extension Go to VS > Manage Extensions > Search ‘Power Platform Tools Now, navigate to Tools > Options > Power Platform Tools and enable the specified parameters. Now, go to Tools > Connect to Dataverse Always show the full list of organizations. Avoid signing in with your current Windows user if it’s not the same account you’ve already connected to in Visual Studio. You can view the environments you previously created in PowerShell – just select the one you set up earlier. Choose the default option, unless you’re planning to create specific components for D365 CE or Power Platform—in that case, it’s best to create a dedicated solution and publisher for your work. If the X++ source code for your specific UnO DevBox version (e.g., 10.0.35) hasn’t been downloaded yet, you’ll be prompted to get it locally. After setting up the Power Platform Tools extension and connecting to your Dataverse sandbox, you’ll see an option to install the Finance and Operations extension for Visual Studio, along with the related metadata. If you didn’t get any option you can download it manually by going to “C:\Users\ShubhamPrajapati\AppData\Local\Microsoft\Dynamics365\10.0.2263.74” Meanwhile, in the background, the PackageLocalDirectory is being extracted. You can monitor the progress by going to View > Output. The installation typically takes around 30 minutes. After installation, you’ll see a few prompts the first time you open Visual Studio—just click “Yes” to continue. As you can see, all models have been downloaded successfully. You can switch between Classic View and Model View by right-clicking on the AOT. Once that’s done, navigate to Tools > Options > Power Platform Tools and apply the required changes as shown in the image below. The final step is to configure the Finance & Operations extension. In my case, I use LocalDB for the Cross Reference (Cross Ref) Database—it’s convenient because it’s already included when you install Visual Studio. If you’re using LocalDB, ensure your connection string is correct. A typical value is: (localdb)\ To set up LocalDB (if not already initialized), open Command Prompt and run: sqllocaldb create MSSQLLocalDB -s This command initializes and starts the LocalDB instance. Once LocalDB is running, your Cross Reference Database will be restored. This enables key development features such as: These features significantly enhance the development experience by improving code navigation and reference tracking. If you receive errors when trying to open certain class files (which are XML files under the hood), it’s likely because the Modeling SDK is not installed. This SDK is essential for working with … Continue reading A Unified Approach to Developing Finance and Operations Applications

Share Story :

Mastering String Functions in Business Central: Practical Examples with AL

When working with Microsoft Dynamics 365 Business Central, string manipulation is an essential part of everyday development. From reversing names to formatting messages, AL provides multiple ways to handle text. In this blog, we’ll explore different approaches to string handling through practical examples, including custom logic and built-in AL string functions. Why String Handling Matters in Business Central Strings are everywhere—customer names, item descriptions, invoice messages, and more. Being able to manipulate these strings efficiently allows developers to: Let’s dive into some real-world AL examples where we extend the Customer List page with new actions for string manipulation. Part 1: Custom String Handling Approaches 🔹 a) Method 1: Using List of Text We can reverse a string by adding each character into a List of [Text] and then calling .Reverse(). action(CFS_ReverseSelectedCustomerName) {     Caption = ‘Reverse Customer Name’;     ApplicationArea = All;     trigger OnAction()     var         StringList: List of [Text];         StringLetter: Text;         ReversedString: Text;     begin         ReversedString := ”;         foreach StringLetter in Rec.Name do             StringList.Add(StringLetter);         StringList.Reverse();         foreach StringLetter in StringList do             ReversedString += StringLetter;         Message(ReversedString);     end; } This approach is useful when you want more control over the collection of characters. Output: Method 2: Using Index Manipulation Here, we iterate through the string from end to start and build the reversed string. action(CFS_NewIndex) {     Caption = ‘New Index’;     ApplicationArea = All;     trigger OnAction()     var         ReversedString: Text;         i: Integer;     begin         for i := StrLen(Rec.Name) downto 1 do             ReversedString += CopyStr(Rec.Name, i, 1);         Message(ReversedString);     end; } A more direct approach, simple and efficient for reversing text. Method 3: Using CopyStr The CopyStr function is perfect for extracting characters one by one. action(CFS_NewText) {     Caption = ‘New Text’;     ApplicationArea = All;     trigger OnAction()     var         ReversedString: Text;         i: Integer;     begin         for i := StrLen(Rec.Name) downto 1 do             ReversedString += CopyStr(Rec.Name, i, 1);         Message(ReversedString);     end; } Part 2: Built-in AL String Functions Beyond custom logic, AL offers powerful built-in functions for working with text. Let’s explore a few. Evaluate Examples The Evaluate function converts text into other datatypes (integer, date, boolean, duration, etc.). action(CFS_EvaluateExamples) {     Caption = ‘Evaluate Examples’;     ApplicationArea = All;     trigger OnAction()     var         MyInt: Integer;         MyDate: Date;         MyBool: Boolean;         MyDuration: Duration;         Value: Text;         OkInt: Boolean;         OkDate: Boolean;         OkBool: Boolean;         OkDur: Boolean;     begin         Value := ‘150’;         OkInt := Evaluate(MyInt, Value);         Value := ‘2025-09-01’;         OkDate := Evaluate(MyDate, Value);         Value := ‘TRUE’;         OkBool := Evaluate(MyBool, Value);         Value := ‘3d 5h 45m’;         OkDur := Evaluate(MyDuration, Value);         Message(           ‘Integer = %1 (Ok: %2)\Date = %3 (Ok: %4)\Boolean = %5 (Ok: %6)\Duration = %7 (Ok: %8)’,           MyInt, OkInt,           MyDate, OkDate,           MyBool, OkBool,           MyDuration, OkDur);     end; } Super handy when parsing user input or imported text data. String Functions Examples Now let’s use some of the most common string functions in AL. action(CFS_StringFunctions) {     Caption = ‘String Functions’;     ApplicationArea = All;     trigger OnAction()     var         SourceTxt: Text[100];         CopyTxt: Text[50];         DelTxt: Text[50];         Len: Integer;         SubstTxt: Text[100];         UpperTxt: Text[50];         LowerTxt: Text[50];     begin         SourceTxt := ‘Dynamics 365 Business Central’;         CopyTxt := CopyStr(SourceTxt, 1, 8); // “Dynamics”         DelTxt := DelStr(SourceTxt, 1, 9);   // “365 Business Central”         Len := StrLen(SourceTxt);            // 29         SubstTxt := StrSubstNo(‘Hello %1, welcome to %2!’, ‘User’, ‘Business Central’);         UpperTxt := UpperCase(SourceTxt);    // “DYNAMICS 365 BUSINESS CENTRAL”         LowerTxt := LowerCase(SourceTxt);    // “dynamics 365 business central”         Message(           ‘Original: %1\CopyStr: %2\DelStr: %3\Length: %4\Substitute: %5\Upper: %6\Lower: %7’,           SourceTxt, CopyTxt, DelTxt, Len, SubstTxt, UpperTxt, LowerTxt);     end; } These built-in functions save time and make string handling straightforward. To conclude, whether you’re reversing a customer’s name, converting text into other data types, or formatting user-friendly messages, AL’s string manipulation capabilities are both flexible and powerful. By combining custom logic with built-in functions, you can handle almost any text-related scenario in Business Central. Try experimenting with these functions in your own extensions—you’ll be surprised how often they come in handy! We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com.

Share Story :

Getting Started with the Event Recorder in Business Central

When developing customizations or extensions in Microsoft Dynamics 365 Business Central, working with events is a best practice. Events help ensure your code is upgrade-safe and cleanly decoupled from the standard application code. However, one common challenge developers face is figuring out which events are triggered during certain actions in the system. That’s where the Event Recorder comes in. What Is the Event Recorder? The Event Recorder is a built-in tool in Business Central that allows developers to monitor and log all published and subscribed events during a user session. Think of it as a “black box” recorder for event-driven development. It helps you identify: This tool is extremely helpful when you’re customizing functionality using event subscriptions (as per AL best practices) but aren’t sure which event to subscribe to. Why Use the Event Recorder? Traditionally, developers had to dig through AL code or documentation to find the right event to subscribe to. With the Event Recorder, this becomes faster and more efficient. Key benefits include: How to Use the Event Recorder Here’s a step-by-step guide: Step 1: Open Event Recorder Step 2: Start a New Recording Step 3: Stop Recording Step 4: Review the Results Best Practices Sample Use Case Suppose you’re trying to add custom logic every time a Sales Invoice is posted. You’re not sure which event gets triggered at that point. Using the Event Recorder: Now, you can write a subscriber in your AL code like this: [EventSubscriber(ObjectType::Page, Page::”Customer List”, ‘OnAfterGetRecordEvent’, ”, true, true)] local procedure MyProcedure() begin // Your custom logic here end; Limitations While powerful, the Event Recorder does have some limitations: To conclude, Event Recorder is an indispensable tool for any AL developer working in Business Central. It simplifies the discovery of relevant events, helps maintain clean and upgrade-safe extensions, and boosts overall development efficiency. Whether you’re new to AL or a seasoned developer, incorporating the Event Recorder into your workflow will save you time. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

Generate Enhanced QR Codes in Business Central Using AL and QuickChart API

QR codes have become a standard tool for sharing data quickly and efficiently—whether it’s for product labeling, document tracking, or digital payments. Now, you can generate customized QR codes and barcodes directly within Microsoft Dynamics 365 Business Central using a simple action. This feature allows users to choose the barcode type and size, embed the image into a record, and optionally download it—all with just a few clicks. It’s an easy way to enhance records with scannable information, without leaving Business Central or needing external tools. In this article, we’ll walk through how this feature works and how it can be used in real business scenarios. What This Feature Does? The “Generate Enhanced QR Code” action gives users the ability to quickly create and manage barcodes within Business Central. Here’s what it can do: Business Scenarios Where This Shines AL Code Behind the Feature Output: Choose an image size (Small, Medium, Large). Select a barcode type (QR, Swiss QR, Aztec, Data Matrix, Telepen). Store the generated image in the Picture field of the item record. To conclude, this customization shows how a simple AL code extension can greatly boost efficiency in Microsoft Dynamics 365 Business Central. By enabling quick generation and embedding of QR codes and barcodes, you eliminate manual steps and streamline processes across departments—from inventory to sales and beyond. With support for multiple barcode types, customizable sizes, and built-in download and validation prompts, this feature brings powerful functionality right into the user’s workflow—no external tools needed. Whether you’re in warehousing, retail, manufacturing, or pharma, this tool helps standardize product labeling and enhances traceability with just a few clicks. Looking ahead? You can extend this further by including additional record fields, customizing encoding logic, or supporting more document types like purchase orders or invoices. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

Enhancing Number Series in Business Central: New Architecture and Copilot Integration

As Business Central continues to advance, its features and functionalities are also evolving. One significant enhancement is the introduction of a new series system. This update is designed to simplify the process of assigning numbers to various documents, ensuring both consistency and efficiency. In this blog, we’ll explore the core aspects of this new number series and how you can leverage it in your Business Central environment. Understanding the Basics Number series in Business Central serve as unique identifiers for documents such as sales orders, purchase orders, and invoices. These identifiers play a crucial role in effectively tracking and managing documents. With the introduction of the new number series, improvements have been made to enhance flexibility and provide better control over these identifiers. What’s New? Previously, Business Central used the NoSeriesManagement codeunit for managing number series. The updated system introduces two distinct entities: This new structure brings a more organized and streamlined approach to number series management, enabling enhanced customization for different document types and processes. Refactoring Your Code With these updates, the NoSeriesManagement codeunit is now marked for deprecation. When you use it, you may encounter a warning like: “Codeunit ‘NoSeriesManagement’ is marked for removal. Reason: Please use the ‘No. Series’ and ‘No. Series – Batch’ codeunits instead. Tag: 24.0”. Here’s a step-by-step guide to refactoring your code for the new system: 1. Identify Usage First, locate all instances where the NoSeriesManagement codeunit is referenced in your codebase. This includes direct calls or any references to its functions. 2. Replace with New Codeunits Update these references to use the appropriate new codeunit: How to Implement the New Codeunits a. Using “No. Series” This codeunit is used for standard number series management tasks. Below is an example of how it works: var    NoSeries: Codeunit “No. Series”;begin    NoSeries.GetLastNoUsed();    NoSeries.GetNextNo();end; b. Using “No. Series – Batch” The “No. Series – Batch” codeunit is designed for efficient batch processing of multiple number series. Use its methods like PeekNextNo to retrieve the next number without modifying the series. var    NoSeriesBatch: Codeunit “No. Series – Batch”;begin    NoSeriesBatch.GetLastNoUsed();    NoSeriesBatch.PeekNextNo();end; Example: Before and After Refactoring Before Refactoring: After Refactoring: Suggesting No. Series Using Copilot in Business Central Business Central’s Copilot integration simplifies generating and managing No. Series for different modules. Follow this step-by-step guide to utilize this feature effectively: 2. Create a New Number Series 3. Generate Number Series for a Specific Module 4. Modify an Existing Number Series 5. Prepare Number Series for the Next Year This feature empowers users to efficiently manage No. Series with minimal manual effort, ensuring consistency and saving valuable time. Explore the Copilot suggestions to optimize your workflow in Business Central! To conclude, the advancements in Business Central’s Number Series management, with the introduction of the new architecture and Copilot integration, offer a significant leap in flexibility, efficiency, and user experience. The updated “No. Series” and “No. Series – Batch” codeunits streamline workflows, while Copilot simplifies the creation, modification, and futureproofing of number series with intelligent suggestions. By adopting these features, businesses can ensure consistency, reduce manual errors, and save valuable time, making their operations more streamlined and future ready. Explore these enhancements today to unlock the full potential of Business Central! We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

Implementing Encryption and Decryption Functions via API in Business Central

In Microsoft Dynamics 365 Business Central, securing sensitive data like passwords is crucial for protecting both businesses and customers. By the end of this post, you will understand how passwords are encrypted before being stored and decrypted only when necessary. This ensures that passwords remain secure, minimizing exposure and building trust. 1. Storing Encrypted Passwords Passwords are encrypted before being stored in the database to ensure they are protected. This prevents anyone from accessing passwords in plain text, even if they gain unauthorized access to the database. Here’s an example of how a custom table, CFSCustomPage, stores encrypted passwords using the EncodePassword procedure. In the above code, the password is encrypted before being stored in the database to ensure the data remains secure. The EncodePassword procedure is used for encrypting the password. 2. Decrypting Passwords When Needed When passwords need to be retrieved, they are decrypted using the DecodePassword procedure. This ensures that passwords are only accessible when required, minimizing exposure. Here’s the decryption function: In the above code, passwords are decrypted only when needed, allowing the system to securely handle sensitive data. 3. Returning Decrypted Passwords via API For external systems or applications requiring access to customer data, Business Central ensures that passwords are only decrypted and transmitted securely via API. This way, customer information remains protected throughout the process. Here’s how the API Page CFSCustPageAPI handles this: The API exposes the encrypted password and only decrypts it when accessed securely through the API. 4. Returning Decrypted Passwords in a List Page Passwords can also be decrypted and displayed in a list page when necessary, ensuring they are only shown to authorized users. This is done using the DecodePassword function in the page CFSCustomPage, as shown below: This page allows authorized users to view encrypted passwords, MD5, SHA1, SHA512, and AES encrypted passwords, and also decrypt them when necessary. 5. Best Practices for Password Security 6. Encryption Types Used in the System Here are the different types of encryptions and hashing methods used in Business Central: Code: table 71983576 CFSCustomPage {     Caption = ‘CustomPage’;     DataClassification = ToBeClassified;     fields     {         field(71983575; “No.”; Code[20])         {             Caption = ‘No.’;             DataClassification = CustomerContent;         }         field(71983576; Name; Text[50])         {             Caption = ‘Name’;             DataClassification = CustomerContent;         }         field(71983577; Password; Text[365])         {             Caption = ‘Password’;             DataClassification = CustomerContent;         }     }     keys     {         key(PK; “No.”)         {             Clustered = true;         }     }     // Procedure to encode (encrypt) a password     [ServiceEnabled]     procedure EncodePassword(var Password: Text[365])     var         EncryptedPassword: Text[365];     begin         // Encrypt the password using the Encrypt function         EncryptedPassword := Encrypt(Password);         // Assign the encrypted password back to the Password field         Password := EncryptedPassword;     end;     // Procedure to decode (decrypt) the password     [ServiceEnabled]     procedure DecodePassword(EncryptedPassword: Text[365]): Text     var         DecryptedPassword: Text;     begin         // Decrypt the password using the Decrypt function         DecryptedPassword := Decrypt(EncryptedPassword);         // Return the decrypted password         exit(DecryptedPassword);     end;     // Procedure to generate MD5 hash of a password     procedure MD5Hash(Pwd: Text): Text     var         CryptographyManagement: Codeunit “Cryptography Management”;         HashAlgorithmType: Option MD5,SHA1,SHA256,SHA384,SHA512;     begin         // Generate and return the MD5 hash of the password         exit(CryptographyManagement.GenerateHash(Pwd, HashAlgorithmType::MD5));     end;     // Procedure to generate SHA1 hash of a password     procedure SHA1(Pwd: Text): Text     var         CryptographyManagement: Codeunit “Cryptography Management”;         HashAlgorithmType: Option MD5,SHA1,SHA256,SHA384,SHA512;     begin         // Generate and return the SHA1 hash of the password         exit(CryptographyManagement.GenerateHash(Pwd, HashAlgorithmType::SHA1));     end;     // Procedure to generate SHA512 hash of a password     procedure SHA512(Pwd: Text): Text     var         CryptographyManagement: Codeunit “Cryptography Management”;         HashAlgorithmType: Option MD5,SHA1,SHA256,SHA384,SHA512;     begin         // Generate and return the SHA512 hash of the password         exit(CryptographyManagement.GenerateHash(Pwd, HashAlgorithmType::SHA512));     end;     // AES Encryption and Decryption example     procedure AESEncryptionExample(Passowrd: Text): TEXT     var         RijndaelCryptography: Codeunit “Rijndael Cryptography”;         Base64Convert: Codeunit “Base64 Convert”;         EncryptedText: Text;         DecryptedText: Text;         SecretTexts: SecretText;     begin         // Convert the encryption key ‘1106198321061984’ to Base64 format and store it in SecretTexts         SecretTexts := Base64Convert.ToBase64(‘1106198321061984’);         // Set the encryption key and initialization vector (IV) using Base64-encoded values         RijndaelCryptography.SetEncryptionData(SecretTexts, Base64Convert.ToBase64(‘ITGateWayXyZ1234’));         // Set the AES block size to 128 bits (standard AES block size)         RijndaelCryptography.SetBlockSize(128);         // Set the cipher mode for AES to CBC (Cipher Block Chaining)         RijndaelCryptography.SetCipherMode(‘CBC’);         // Set the padding mode for AES encryption to PKCS7 (standard padding scheme for block ciphers)         RijndaelCryptography.SetPaddingMode(‘PKCS7’);         // Encrypt the password using AES encryption         EncryptedText := RijndaelCryptography.Encrypt(Passowrd);         // Decrypt the encrypted password using … Continue reading Implementing Encryption and Decryption Functions via API in Business Central

Share Story :

Business Central Translations: Working with XLIFF Files – Part 2

By the end of this guide, you will be able to generate, edit, and implement XLIFF files in Microsoft Dynamics 365 Business Central to support multiple languages seamlessly. This will enable your application to display translated content for UI labels, reports, and messages, ensuring a smooth experience for users across different regions. Why does this matter? Using XLIFF files, businesses can easily localize Business Central applications without modifying source code, making multilingual support efficient and scalable. By leveraging tools like NAB AL Tools, translations can be managed effortlessly, enhancing global usability. Generating an XLIFF File To illustrate the XLIFF process, let’s go through an example where we add a custom field named “Custom_Field” on the Customer Card page. Step 1: Creating a Custom Field First, we create a new field, Custom_Field, on the Customer Card page using AL code: Step 2: Enabling Translation File Feature In the app.json file, ensure that the TranslationFile feature is enabled: Step 3: Building the Project Now, build the extension using the shortcut CTRL + Shift + B. This will generate an .xlf file automatically in the translation folder. By default, the file is generated in English (en-US). Using NAB Extension for Translation To simplify translation tasks, you can install the NAB AL Tools extension from the Visual Studio Code marketplace. This extension helps in managing translation files efficiently by allowing automated translation suggestions and quick file updates. Steps to Use NAB AL Tools: A) Install NAB AL Tools. B) Press CTRL + Shift + P and select NAB: Create translation XLF for new language. C) Enter the language code (e.g., fr-FR for French – France). D) Choose Yes when prompted to match translations from BaseApp. E) A new fr-FR.xlf file will be generated. Translating the XLIFF File To translate the XLIFF file into another language (e.g., French), follow these steps: Example: Translating Report Labels In Business Central RDLC reports, hardcoded text values can also be translated using labels. Instead of writing static text, define labels within the AL code: Using FieldCaption ensures that report labels dynamically adapt to the selected language, improving localization without manual modifications. When switching languages, the label automatically retrieves the corresponding translation from the XLIFF file. Modifying Standard Fields Standard field names in Business Central can also be modified using the BaseApplication.g.xlf file. You can find this file in public repositories, such as: BaseApplication.g.xlf Modifying this file allows changes to default field captions and system messages in multiple languages. Insert value in different languages via AL In Microsoft Dynamics 365 Business Central, AL enables efficient multilingual data handling. The image above illustrates a Customer Card where the “Nom” (Name) field contains the value “testing.” The AL code extends the Customer table, adding a custom field and an onInsert trigger to validate the Name field with “testing.” This ensures data consistency across different language settings. By leveraging AL, developers can automate multilingual field values, enhancing Business Central’s global usability. To conclude, managing translations in Business Central using XLIFF files enables businesses to support multiple languages efficiently. By generating XLIFF files, modifying them for translation, and leveraging tools like NAB AL Tools, businesses can ensure accurate and seamless localization. For further refinements, modifying report labels and system fields enhances multilingual support, improving the user experience across global deployments. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange